package com.initialize.pub.generate.dao;

import com.initialize.pub.generate.pojo.Site;
import com.initialize.pub.generate.pojo.SiteExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface SiteMapper {
    @SelectProvider(type=SiteSqlProvider.class, method="countByExample")
    long countByExample(SiteExample example);

    @DeleteProvider(type=SiteSqlProvider.class, method="deleteByExample")
    int deleteByExample(SiteExample example);

    @Delete({
        "delete from site",
        "where key = #{key,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String key);

    @Insert({
        "insert into site (key, value)",
        "values (#{key,jdbcType=VARCHAR}, #{value,jdbcType=LONGVARCHAR})"
    })
    int insert(Site record);

    @InsertProvider(type=SiteSqlProvider.class, method="insertSelective")
    int insertSelective(Site record);

    @SelectProvider(type=SiteSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="key", property="key", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="value", property="value", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<Site> selectByExampleWithBLOBs(SiteExample example);

    @SelectProvider(type=SiteSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="key", property="key", jdbcType=JdbcType.VARCHAR, id=true)
    })
    List<Site> selectByExample(SiteExample example);

    @Select({
        "select",
        "key, value",
        "from site",
        "where key = #{key,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="key", property="key", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="value", property="value", jdbcType=JdbcType.LONGVARCHAR)
    })
    Site selectByPrimaryKey(String key);

    @UpdateProvider(type=SiteSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Site record, @Param("example") SiteExample example);

    @UpdateProvider(type=SiteSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") Site record, @Param("example") SiteExample example);

    @UpdateProvider(type=SiteSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Site record, @Param("example") SiteExample example);

    @UpdateProvider(type=SiteSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Site record);

    @Update({
        "update site",
        "set value = #{value,jdbcType=LONGVARCHAR}",
        "where key = #{key,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(Site record);
}